package com.hayato.demo.client.Info;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.hayato.demo.client.model.CustomerModel;

@PersistenceCapable
public class CustomerInfo {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;

	@Persistent
	private String name;

	@Persistent
	private String address;

	@Persistent
	private String telephone;

	@Persistent
	private String email_address;

	@Persistent
	private Date date_created;

	@Persistent
	private Date date_updated;

	public CustomerInfo(String name, String address, String telephone,
			String email_address, Date create, Date update) {
		this.name = name;
		this.address = address;
		this.telephone = telephone;
		this.email_address = email_address;
		this.date_created = create;
		this.date_updated = update;
	}
	public CustomerInfo(){
		
	}
	public Long getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getEmail_address() {
		return email_address;
	}

	public void setEmail_address(String email_address) {
		this.email_address = email_address;
	}

	public Date getDate_created() {
		return date_created;
	}

	public void setDate_created(Date date_created) {
		this.date_created = date_created;
	}

	public Date getDate_updated() {
		return date_updated;
	}

	public void setDate_updated(Date date_updated) {
		this.date_updated = date_updated;
	}
	public CustomerModel toModel(){
		CustomerModel model=new CustomerModel();
		model.setId(getId());
		model.setEmail_address(getEmail_address());
		model.setAddress(getAddress());
		model.setName(getName());
		model.setTelephone(getTelephone());
		return model;
	}
}
